package fun.yyds.entity.es;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@Document(indexName = "efk_log*", createIndex = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class EsLogDocument {
    @Id
    private String id;

    @Field(type = FieldType.Text)
    private String logSource;

    @Field(type = FieldType.Text)
    private String operaResult;

    @Field(type = FieldType.Text)
    private String module;

    @Field(type = FieldType.Text)
    private String logType;

    @Field(type = FieldType.Text)
    private String level;

    @Field(type = FieldType.Text)
    private String content;

    @Field(type = FieldType.Text)
    private String userAccount;

    @Field(type = FieldType.Text)
    private String operaTime;

    @Field(type = FieldType.Text)
    private String ip;

    @Field(name = "@timestamp", type = FieldType.Date)
    @JsonProperty("@timestamp")
    private String timestamp;


}
